package view.components;

import javax.swing.JComboBox;
import javax.swing.JPanel;

import model.Constants;
import model.IPAddress;
import model.Subnet;

public class IpComboBox extends JPanel {

	private static final long serialVersionUID = 1L;

	private final JComboBox combo;

	public IpComboBox(Subnet sub) {

		combo = new JComboBox();
		for (IPAddress element : sub.getIpAddressList()) {
			if (element.getAdditionalInfo().equals(Constants.FREEIP)) {
				combo.addItem(element.getAddress());
			}
		}
		this.add(combo);

	}

	public JComboBox getBox() {
		return combo;
	}

}
